A computer program will be developed that can determine the position, orientation, and strength of a current dipole in the brain from electroencephalographic or magnetoencephalographic data. The electrical properties of the head will be modeled using a three-layer model: brain, skull, and scalp. A realistic head shape will be used. The program will be used to localize the focus of epileptic discharges and to analyze evoked potentials. Comparisons will be made between the realistically shaped head model and the three-sphere model. The model will be used to localize the source of interictal spikes in patients who are candidates for epilepsy surgery.